<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="layui/css/layui.css" media="all" rel="stylesheet">
    <script src="layui/layui.js" type="text/javascript"></script>
    <script src="js/jquery-3.3.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#student_add").click(function () {
                $("iframe").attr("src", "student_add.html");
            });
            $("#student_import").click(function () {
                $("iframe").attr("src", "student_import.html");
            });
            $("#student_search").click(function () {
                $("iframe").attr("src", "student_search.html");
            });
            $("#teacher_add").click(function () {
                $("iframe").attr("src", "teacher_add.html");
            });
            $("#teacher_import").click(function () {
                $("iframe").attr("src", "teacher_import.html");
            });
            $("#teacher_search").click(function () {
                $("iframe").attr("src", "teacher_search.html");
            });
            $("#class_add").click(function () {
                $("iframe").attr("src", "class_add.html");
            });
            $("#class_search").click(function () {
                $("iframe").attr("src", "class_search.html");
            });
            $("#course_add").click(function () {
                $("iframe").attr("src", "course_add.html");
            });
            $("#course_search").click(function () {
                $("iframe").attr("src", "class_search.html");
            });
            $("#database_backup").click(function () {
                $.ajax({
                    url: '/file/backup' , //请求url
                    data:'', //请求参数，类似于username=xxx&password=xxx
                    type: 'put', //请求方式
                    dataType: 'json', //返回值的类型
                    success: function (result) {  //服务器成功返回时执行的函数
                        if (result.code == 2000) {
                            alert("备份完成！");
                        } else {
                            alert(result.msg);
                        }
                    }
                });
            });
            $("#database_recover").click(function () {
                $.ajax({
                    url: '/file/recover' , //请求url
                    data:'', //请求参数，类似于username=xxx&password=xxx
                    type: 'put', //请求方式
                    dataType: 'json', //返回值的类型
                    success: function (result) {  //服务器成功返回时执行的函数
                            alert("恢复完成！");
                    }
                });
            });
        })
    </script>
</head>

<div class="layui-layout layui-layout-admin">
    <body class="layui-layout-body">
    <!-- 顶部菜单开始 -->
    <div class="layui-header">
        <div class="layui-logo">在线考试系统-管理员</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img class="layui-nav-img" src="images/img.jpeg"/>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/login.html">退出系统</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <!-- 顶部菜单结束 -->

    <!-- 左侧菜单开始 -->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">学生管理</a>
                    <dl class="layui-nav-child">
                        <dd class="layui-this"><a href="javascript:void(0)" id="student_add">添加学生信息</a></dd>
                        <dd><a href="javascript:void(0)" id="student_import">导入学生信息</a></dd>
                        <dd><a href="javascript:void(0)" id="student_search">查询学生信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">教师管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0)" id="teacher_add">添加教师信息</a></dd>
                        <dd><a href="javascript:void(0)" id="teacher_import">导入教师信息</a></dd>
                        <dd><a href="javascript:void(0)" id="teacher_search">查询教师信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">班级管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0)" id="class_add">添加班级信息</a></dd>
                        <dd><a href="javascript:void(0)" id="class_search">查询班级信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">课程管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0)" id="course_add">添加课程信息</a></dd>
                        <dd><a href="javascript:void(0)" id="course_search">查询课程信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">数据库管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0)" id="database_backup">备份数据库信息</a></dd>
                        <dd><a href="javascript:void(0)" id="database_recover">恢复数据库信息</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 左侧菜单结束 -->

    <!-- 主体开始 -->
    <div class="layui-body">

        <iframe src="student_search.html" style="width: 100%;height: 100%;border: 0px"></iframe>

    </div>
    <!-- 主体结束 -->

    <!-- 底部开始 -->
    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © 黄光辉
    </div>
    <!-- 底部结束 -->
    </body>
</div>
<script>
    //二级菜单联动
    layui.use('element', function () {
        var element = layui.element;

    });
</script>
</body>
</html>